import request from '@/utils/request'

// 查询当前的操作用户信息
export function queryUserInfo(data) {
    return request({
        url: '/purchase/apply/queryUserInfo',
        method: 'get',
        params: data
    })
}

// 保存申请单为草稿
export function addApplyBill(data) {
    return request({
        url: '/purchase/apply/addApplyBill',
        method: 'post',
        data: data
    })
}

//查询申请单列表
export function listApplyBill(data) {
    return request({
        url: '/purchase/apply/listApplyBill',
        method: 'get',
        params: data
    })
}

//删除申请单
export function delApplyBill(data) {
    return request({
        url: '/purchase/apply/delApplyBill',
        method: 'post',
        data: data
    })
}

//查询该申请单的用户信息以及申请单货品清单
export function queryGoodsBillAndUserInfo(data) {
    return request({
        url: '/purchase/apply/queryGoodsBillAndUserInfo',
        method: 'post',
        data: data
    })
}

//修改采购申请单
export function modifyApplyBill(data) {
    return request({
        url: '/purchase/apply/modifyApplyBill',
        method: 'post',
        data: data
    })
}

//采购申请发起
export function submitApproval(data) {
    return request({
        url: '/purchase/apply/submitApproval',
        method: 'post',
        data: data
    })
}

//查询待办列表
export function listTodoPurApply(data) {
    return request({
        url: '/purchase/apply/listTodoPurApply',
        method: 'post',
        data: data
    })
}

//采购单审批提交
export function approvalApply(data) {
    return request({
        url: '/purchase/apply/approvalApply',
        method: 'post',
        data: data
    })
}

//分页查询历史已办任务
export function queryApplyApprovalHisList(data) {
    return request({
        url: '/purchase/apply/queryApplyApprovalHisList',
        method: 'get',
        params: data
    })
}
